﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Globalization;
using System.Data;
using System.Data.Common;
using System.Xml;
using System.Text;
using LibHuman;

namespace Human
{
	/// <summary>
	/// Summary description for frmCapSoSua.
	/// </summary>
	public class frmCapSo : System.Windows.Forms.Form
	{
		private string TSo="",m_user="",sql="",ten_nd="";
        private AccessData mDB = new AccessData();
        Language lan = new Language();
		public DataSet ds =new DataSet();
		//private Print rpt=new Print();				
		private DataSet ds1=new DataSet();
		private bool bClear=true,admin=false;
        private string v_manv, v_ho, v_bophan;
		private System.Windows.Forms.Label lblTenPhongCT;
		private System.Windows.Forms.Label lblHoTenNVCT;
		private System.Windows.Forms.Label label29;
		private System.Windows.Forms.Label lblMasoNVCT;
        private System.Windows.Forms.Label label28;
        private ToolStrip toolStrip3;
        private ToolStripLabel toolStripLabel3;
        private GroupBox grouphienthi;
        private MaskedTextBox txtDBHYT_CS;
        private MaskedTextBox txtTHTBHYT_CS;
        private MaskedTextBox txtNCBHYT_CS;
        private MaskedTextBox txtNCBHXH_CS;
        private MaskedTextBox txtNDKSDLD_CS;
        private MaskedTextBox txtNChuyenLD_CS;
        private MaskedTextBox txtNCLD_CS;
        private ComboBox cboBHKBHYT_CS;
        private ComboBox cboBHNTBHYT_CS;
        private ComboBox cboBHTN24BHYT_CS;
        private ComboBox cboTBVBHYT_CS;
        private ComboBox cboTBHYT_CS;
        private TextBox txtSTBHYT_CS;
        private TextBox txtNBHXH_CS;
        private TextBox txtTTGTBHXH_CS;
        private TextBox txtSTKTBHXH_CS;
        private ComboBox cboNCBHXH_CS;
        private TextBox txtSSBHXH_CS;
        private TextBox txtSDKLD_CS;
        private TextBox txtCTCQLD_CS;
        private ComboBox cboTLD_CS;
        private TextBox txtNCapLD_CS;
        private TextBox txtSSLD_CS;
        private Label label109;
        private Label label108;
        private Label label107;
        private Label label106;
        private Label label104;
        private Label label102;
        private Label label101;
        private Label label97;
        private Label label88;
        private Label label89;
        private Label label90;
        private Label label87;
        private Label label80;
        private Label label84;
        private Label label91;
        private Label label86;
        private Label label105;
        private Label label103;
        private Label label99;
        private Label label95;
        private Label label93;
        private Label label96;
        private Label label94;
        private Label label98;
        private Label label100;
        private Label label92;
        private Label label79;
        private MaskedBox.MaskedBox dtpNgayCongTac;
        private TextBox txtTSo;
        private Label label27;
        private Panel panButLyLich;
        private Button butThem;
        private Button butHuy;
        private Button butKetThuc;
        private Button btnSua;
        private ToolTip toolTip1;
        private IContainer components;

		public frmCapSo(string manv,string hoten,string madv,bool m_admin,string tennd)
		{
			InitializeComponent();
            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            m_user = mDB.user;
			lblMasoNVCT.Text=manv;
			lblHoTenNVCT.Text=hoten;
			lblTenPhongCT.Text=madv;			
			load_LBL(manv,hoten,madv);
			tongso();
            admin = m_admin;
            ten_nd = tennd;
			if (Screen.PrimaryScreen.WorkingArea.Width>=1000)//
			{
				
				this.WindowState=FormWindowState.Normal;
				this.MaximizeBox=false;
			}
			else
			{
				
				this.WindowState=FormWindowState.Maximized;
			}

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmCapSo));
            this.lblTenPhongCT = new System.Windows.Forms.Label();
            this.lblHoTenNVCT = new System.Windows.Forms.Label();
            this.label29 = new System.Windows.Forms.Label();
            this.lblMasoNVCT = new System.Windows.Forms.Label();
            this.label28 = new System.Windows.Forms.Label();
            this.toolStrip3 = new System.Windows.Forms.ToolStrip();
            this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
            this.grouphienthi = new System.Windows.Forms.GroupBox();
            this.txtDBHYT_CS = new System.Windows.Forms.MaskedTextBox();
            this.txtTHTBHYT_CS = new System.Windows.Forms.MaskedTextBox();
            this.txtNCBHYT_CS = new System.Windows.Forms.MaskedTextBox();
            this.txtNCBHXH_CS = new System.Windows.Forms.MaskedTextBox();
            this.txtNDKSDLD_CS = new System.Windows.Forms.MaskedTextBox();
            this.txtNChuyenLD_CS = new System.Windows.Forms.MaskedTextBox();
            this.txtNCLD_CS = new System.Windows.Forms.MaskedTextBox();
            this.cboBHKBHYT_CS = new System.Windows.Forms.ComboBox();
            this.cboBHNTBHYT_CS = new System.Windows.Forms.ComboBox();
            this.cboBHTN24BHYT_CS = new System.Windows.Forms.ComboBox();
            this.cboTBVBHYT_CS = new System.Windows.Forms.ComboBox();
            this.cboTBHYT_CS = new System.Windows.Forms.ComboBox();
            this.txtSTBHYT_CS = new System.Windows.Forms.TextBox();
            this.txtNBHXH_CS = new System.Windows.Forms.TextBox();
            this.txtTTGTBHXH_CS = new System.Windows.Forms.TextBox();
            this.txtSTKTBHXH_CS = new System.Windows.Forms.TextBox();
            this.cboNCBHXH_CS = new System.Windows.Forms.ComboBox();
            this.txtSSBHXH_CS = new System.Windows.Forms.TextBox();
            this.txtSDKLD_CS = new System.Windows.Forms.TextBox();
            this.txtCTCQLD_CS = new System.Windows.Forms.TextBox();
            this.cboTLD_CS = new System.Windows.Forms.ComboBox();
            this.txtNCapLD_CS = new System.Windows.Forms.TextBox();
            this.txtSSLD_CS = new System.Windows.Forms.TextBox();
            this.label109 = new System.Windows.Forms.Label();
            this.label108 = new System.Windows.Forms.Label();
            this.label107 = new System.Windows.Forms.Label();
            this.label106 = new System.Windows.Forms.Label();
            this.label104 = new System.Windows.Forms.Label();
            this.label102 = new System.Windows.Forms.Label();
            this.label101 = new System.Windows.Forms.Label();
            this.label97 = new System.Windows.Forms.Label();
            this.label88 = new System.Windows.Forms.Label();
            this.label89 = new System.Windows.Forms.Label();
            this.label90 = new System.Windows.Forms.Label();
            this.label87 = new System.Windows.Forms.Label();
            this.label80 = new System.Windows.Forms.Label();
            this.label84 = new System.Windows.Forms.Label();
            this.label91 = new System.Windows.Forms.Label();
            this.label86 = new System.Windows.Forms.Label();
            this.label105 = new System.Windows.Forms.Label();
            this.label103 = new System.Windows.Forms.Label();
            this.label99 = new System.Windows.Forms.Label();
            this.label95 = new System.Windows.Forms.Label();
            this.label93 = new System.Windows.Forms.Label();
            this.label96 = new System.Windows.Forms.Label();
            this.label94 = new System.Windows.Forms.Label();
            this.label98 = new System.Windows.Forms.Label();
            this.label100 = new System.Windows.Forms.Label();
            this.label92 = new System.Windows.Forms.Label();
            this.label79 = new System.Windows.Forms.Label();
            this.dtpNgayCongTac = new MaskedBox.MaskedBox();
            this.txtTSo = new System.Windows.Forms.TextBox();
            this.label27 = new System.Windows.Forms.Label();
            this.panButLyLich = new System.Windows.Forms.Panel();
            this.btnSua = new System.Windows.Forms.Button();
            this.butThem = new System.Windows.Forms.Button();
            this.butHuy = new System.Windows.Forms.Button();
            this.butKetThuc = new System.Windows.Forms.Button();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.toolStrip3.SuspendLayout();
            this.grouphienthi.SuspendLayout();
            this.panButLyLich.SuspendLayout();
            this.SuspendLayout();
            // 
            // lblTenPhongCT
            // 
            this.lblTenPhongCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblTenPhongCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblTenPhongCT.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.lblTenPhongCT.Location = new System.Drawing.Point(579, 5);
            this.lblTenPhongCT.Name = "lblTenPhongCT";
            this.lblTenPhongCT.Size = new System.Drawing.Size(207, 40);
            this.lblTenPhongCT.TabIndex = 4;
            this.lblTenPhongCT.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // lblHoTenNVCT
            // 
            this.lblHoTenNVCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblHoTenNVCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblHoTenNVCT.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.lblHoTenNVCT.Location = new System.Drawing.Point(330, 5);
            this.lblHoTenNVCT.Name = "lblHoTenNVCT";
            this.lblHoTenNVCT.Size = new System.Drawing.Size(240, 40);
            this.lblHoTenNVCT.TabIndex = 3;
            this.lblHoTenNVCT.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // label29
            // 
            this.label29.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label29.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label29.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.label29.Location = new System.Drawing.Point(266, 5);
            this.label29.Name = "label29";
            this.label29.Size = new System.Drawing.Size(56, 40);
            this.label29.TabIndex = 2;
            this.label29.Text = "Họ tên ";
            this.label29.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // lblMasoNVCT
            // 
            this.lblMasoNVCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblMasoNVCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblMasoNVCT.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.lblMasoNVCT.Location = new System.Drawing.Point(170, 5);
            this.lblMasoNVCT.Name = "lblMasoNVCT";
            this.lblMasoNVCT.Size = new System.Drawing.Size(80, 40);
            this.lblMasoNVCT.TabIndex = 1;
            this.lblMasoNVCT.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // label28
            // 
            this.label28.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label28.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label28.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.label28.Location = new System.Drawing.Point(105, 5);
            this.label28.Name = "label28";
            this.label28.Size = new System.Drawing.Size(59, 40);
            this.label28.TabIndex = 0;
            this.label28.Text = "Mã số ";
            this.label28.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // toolStrip3
            // 
            this.toolStrip3.AutoSize = false;
            this.toolStrip3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripLabel3});
            this.toolStrip3.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
            this.toolStrip3.Location = new System.Drawing.Point(0, 0);
            this.toolStrip3.Name = "toolStrip3";
            this.toolStrip3.Size = new System.Drawing.Size(794, 51);
            this.toolStrip3.TabIndex = 182;
            this.toolStrip3.Text = "toolStrip3";
            // 
            // toolStripLabel3
            // 
            this.toolStripLabel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.toolStripLabel3.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Bold);
            this.toolStripLabel3.ForeColor = System.Drawing.Color.White;
            this.toolStripLabel3.Name = "toolStripLabel3";
            this.toolStripLabel3.Size = new System.Drawing.Size(90, 48);
            this.toolStripLabel3.Text = "CẤP SỔ ";
            // 
            // grouphienthi
            // 
            this.grouphienthi.Controls.Add(this.txtDBHYT_CS);
            this.grouphienthi.Controls.Add(this.txtTHTBHYT_CS);
            this.grouphienthi.Controls.Add(this.txtNCBHYT_CS);
            this.grouphienthi.Controls.Add(this.txtNCBHXH_CS);
            this.grouphienthi.Controls.Add(this.txtNDKSDLD_CS);
            this.grouphienthi.Controls.Add(this.txtNChuyenLD_CS);
            this.grouphienthi.Controls.Add(this.txtNCLD_CS);
            this.grouphienthi.Controls.Add(this.cboBHKBHYT_CS);
            this.grouphienthi.Controls.Add(this.cboBHNTBHYT_CS);
            this.grouphienthi.Controls.Add(this.cboBHTN24BHYT_CS);
            this.grouphienthi.Controls.Add(this.cboTBVBHYT_CS);
            this.grouphienthi.Controls.Add(this.cboTBHYT_CS);
            this.grouphienthi.Controls.Add(this.txtSTBHYT_CS);
            this.grouphienthi.Controls.Add(this.txtNBHXH_CS);
            this.grouphienthi.Controls.Add(this.txtTTGTBHXH_CS);
            this.grouphienthi.Controls.Add(this.txtSTKTBHXH_CS);
            this.grouphienthi.Controls.Add(this.cboNCBHXH_CS);
            this.grouphienthi.Controls.Add(this.txtSSBHXH_CS);
            this.grouphienthi.Controls.Add(this.txtSDKLD_CS);
            this.grouphienthi.Controls.Add(this.txtCTCQLD_CS);
            this.grouphienthi.Controls.Add(this.cboTLD_CS);
            this.grouphienthi.Controls.Add(this.txtNCapLD_CS);
            this.grouphienthi.Controls.Add(this.txtSSLD_CS);
            this.grouphienthi.Controls.Add(this.label109);
            this.grouphienthi.Controls.Add(this.label108);
            this.grouphienthi.Controls.Add(this.label107);
            this.grouphienthi.Controls.Add(this.label106);
            this.grouphienthi.Controls.Add(this.label104);
            this.grouphienthi.Controls.Add(this.label102);
            this.grouphienthi.Controls.Add(this.label101);
            this.grouphienthi.Controls.Add(this.label97);
            this.grouphienthi.Controls.Add(this.label88);
            this.grouphienthi.Controls.Add(this.label89);
            this.grouphienthi.Controls.Add(this.label90);
            this.grouphienthi.Controls.Add(this.label87);
            this.grouphienthi.Controls.Add(this.label80);
            this.grouphienthi.Controls.Add(this.label84);
            this.grouphienthi.Controls.Add(this.label91);
            this.grouphienthi.Controls.Add(this.label86);
            this.grouphienthi.Controls.Add(this.label105);
            this.grouphienthi.Controls.Add(this.label103);
            this.grouphienthi.Controls.Add(this.label99);
            this.grouphienthi.Controls.Add(this.label95);
            this.grouphienthi.Controls.Add(this.label93);
            this.grouphienthi.Controls.Add(this.label96);
            this.grouphienthi.Controls.Add(this.label94);
            this.grouphienthi.Controls.Add(this.label98);
            this.grouphienthi.Controls.Add(this.label100);
            this.grouphienthi.Controls.Add(this.label92);
            this.grouphienthi.Controls.Add(this.label79);
            this.grouphienthi.Location = new System.Drawing.Point(12, 54);
            this.grouphienthi.Name = "grouphienthi";
            this.grouphienthi.Size = new System.Drawing.Size(774, 374);
            this.grouphienthi.TabIndex = 183;
            this.grouphienthi.TabStop = false;
            // 
            // txtDBHYT_CS
            // 
            this.txtDBHYT_CS.Location = new System.Drawing.Point(289, 318);
            this.txtDBHYT_CS.Mask = "00/00/0000";
            this.txtDBHYT_CS.Name = "txtDBHYT_CS";
            this.txtDBHYT_CS.Size = new System.Drawing.Size(86, 20);
            this.txtDBHYT_CS.TabIndex = 227;
            this.txtDBHYT_CS.ValidatingType = typeof(System.DateTime);
            this.txtDBHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDBHYT_CS_KeyDown);
            this.txtDBHYT_CS.Validated += new System.EventHandler(this.txtDBHYT_CS_Validated);
            // 
            // txtTHTBHYT_CS
            // 
            this.txtTHTBHYT_CS.Location = new System.Drawing.Point(167, 317);
            this.txtTHTBHYT_CS.Mask = "00/00/0000";
            this.txtTHTBHYT_CS.Name = "txtTHTBHYT_CS";
            this.txtTHTBHYT_CS.Size = new System.Drawing.Size(86, 20);
            this.txtTHTBHYT_CS.TabIndex = 226;
            this.txtTHTBHYT_CS.ValidatingType = typeof(System.DateTime);
            this.txtTHTBHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtTHTBHYT_CS_KeyDown);
            this.txtTHTBHYT_CS.Validated += new System.EventHandler(this.txtTHTBHYT_CS_Validated);
            // 
            // txtNCBHYT_CS
            // 
            this.txtNCBHYT_CS.Location = new System.Drawing.Point(471, 290);
            this.txtNCBHYT_CS.Mask = "00/00/0000";
            this.txtNCBHYT_CS.Name = "txtNCBHYT_CS";
            this.txtNCBHYT_CS.Size = new System.Drawing.Size(86, 20);
            this.txtNCBHYT_CS.TabIndex = 224;
            this.txtNCBHYT_CS.ValidatingType = typeof(System.DateTime);
            this.txtNCBHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNCBHYT_CS_KeyDown);
            this.txtNCBHYT_CS.Validated += new System.EventHandler(this.txtNCBHYT_CS_Validated);
            // 
            // txtNCBHXH_CS
            // 
            this.txtNCBHXH_CS.Location = new System.Drawing.Point(363, 185);
            this.txtNCBHXH_CS.Mask = "00/00/0000";
            this.txtNCBHXH_CS.Name = "txtNCBHXH_CS";
            this.txtNCBHXH_CS.Size = new System.Drawing.Size(95, 20);
            this.txtNCBHXH_CS.TabIndex = 218;
            this.txtNCBHXH_CS.ValidatingType = typeof(System.DateTime);
            this.txtNCBHXH_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNCBHXH_CS_KeyDown);
            this.txtNCBHXH_CS.Validated += new System.EventHandler(this.txtNCBHXH_CS_Validated);
            // 
            // txtNDKSDLD_CS
            // 
            this.txtNDKSDLD_CS.Location = new System.Drawing.Point(611, 125);
            this.txtNDKSDLD_CS.Mask = "00/00/0000";
            this.txtNDKSDLD_CS.Name = "txtNDKSDLD_CS";
            this.txtNDKSDLD_CS.Size = new System.Drawing.Size(95, 20);
            this.txtNDKSDLD_CS.TabIndex = 216;
            this.txtNDKSDLD_CS.ValidatingType = typeof(System.DateTime);
            this.txtNDKSDLD_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNDKSDLD_CS_KeyDown);
            this.txtNDKSDLD_CS.Validated += new System.EventHandler(this.txtNDKSDLD_CS_Validated);
            // 
            // txtNChuyenLD_CS
            // 
            this.txtNChuyenLD_CS.Location = new System.Drawing.Point(611, 100);
            this.txtNChuyenLD_CS.Mask = "00/00/0000";
            this.txtNChuyenLD_CS.Name = "txtNChuyenLD_CS";
            this.txtNChuyenLD_CS.Size = new System.Drawing.Size(95, 20);
            this.txtNChuyenLD_CS.TabIndex = 214;
            this.txtNChuyenLD_CS.ValidatingType = typeof(System.DateTime);
            this.txtNChuyenLD_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNChuyenLD_CS_KeyDown);
            this.txtNChuyenLD_CS.Validated += new System.EventHandler(this.txtNChuyenLD_CS_Validated);
            // 
            // txtNCLD_CS
            // 
            this.txtNCLD_CS.Location = new System.Drawing.Point(610, 52);
            this.txtNCLD_CS.Mask = "00/00/0000";
            this.txtNCLD_CS.Name = "txtNCLD_CS";
            this.txtNCLD_CS.Size = new System.Drawing.Size(95, 20);
            this.txtNCLD_CS.TabIndex = 210;
            this.txtNCLD_CS.ValidatingType = typeof(System.DateTime);
            this.txtNCLD_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNCLD_CS_KeyDown);
            this.txtNCLD_CS.Validated += new System.EventHandler(this.txtNCLD_CS_Validated);
            // 
            // cboBHKBHYT_CS
            // 
            this.cboBHKBHYT_CS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboBHKBHYT_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboBHKBHYT_CS.Location = new System.Drawing.Point(639, 343);
            this.cboBHKBHYT_CS.Name = "cboBHKBHYT_CS";
            this.cboBHKBHYT_CS.Size = new System.Drawing.Size(80, 21);
            this.cboBHKBHYT_CS.TabIndex = 231;
            this.cboBHKBHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboBHKBHYT_CS_KeyDown);
            // 
            // cboBHNTBHYT_CS
            // 
            this.cboBHNTBHYT_CS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboBHNTBHYT_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboBHNTBHYT_CS.Location = new System.Drawing.Point(471, 342);
            this.cboBHNTBHYT_CS.Name = "cboBHNTBHYT_CS";
            this.cboBHNTBHYT_CS.Size = new System.Drawing.Size(88, 21);
            this.cboBHNTBHYT_CS.TabIndex = 230;
            this.cboBHNTBHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboBHNTBHYT_CS_KeyDown);
            // 
            // cboBHTN24BHYT_CS
            // 
            this.cboBHTN24BHYT_CS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboBHTN24BHYT_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboBHTN24BHYT_CS.Location = new System.Drawing.Point(166, 341);
            this.cboBHTN24BHYT_CS.Name = "cboBHTN24BHYT_CS";
            this.cboBHTN24BHYT_CS.Size = new System.Drawing.Size(88, 21);
            this.cboBHTN24BHYT_CS.TabIndex = 229;
            this.cboBHTN24BHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboBHTN24BHYT_CS_KeyDown);
            // 
            // cboTBVBHYT_CS
            // 
            this.cboTBVBHYT_CS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboTBVBHYT_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboTBVBHYT_CS.Location = new System.Drawing.Point(471, 316);
            this.cboTBVBHYT_CS.Name = "cboTBVBHYT_CS";
            this.cboTBVBHYT_CS.Size = new System.Drawing.Size(246, 21);
            this.cboTBVBHYT_CS.TabIndex = 228;
            this.cboTBVBHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboTBVBHYT_CS_KeyDown);
            // 
            // cboTBHYT_CS
            // 
            this.cboTBHYT_CS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboTBHYT_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboTBHYT_CS.Location = new System.Drawing.Point(591, 290);
            this.cboTBHYT_CS.Name = "cboTBHYT_CS";
            this.cboTBHYT_CS.Size = new System.Drawing.Size(128, 21);
            this.cboTBHYT_CS.TabIndex = 225;
            this.cboTBHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboTBVBHYT_CS_KeyDown);
            // 
            // txtSTBHYT_CS
            // 
            this.txtSTBHYT_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtSTBHYT_CS.ForeColor = System.Drawing.Color.Red;
            this.txtSTBHYT_CS.Location = new System.Drawing.Point(166, 293);
            this.txtSTBHYT_CS.MaxLength = 20;
            this.txtSTBHYT_CS.Name = "txtSTBHYT_CS";
            this.txtSTBHYT_CS.Size = new System.Drawing.Size(128, 20);
            this.txtSTBHYT_CS.TabIndex = 223;
            this.txtSTBHYT_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSTBHYT_CS_KeyDown);
            this.txtSTBHYT_CS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtSTBHYT_CS_KeyPress);
            // 
            // txtNBHXH_CS
            // 
            this.txtNBHXH_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNBHXH_CS.ForeColor = System.Drawing.Color.Black;
            this.txtNBHXH_CS.Location = new System.Drawing.Point(650, 213);
            this.txtNBHXH_CS.Name = "txtNBHXH_CS";
            this.txtNBHXH_CS.Size = new System.Drawing.Size(49, 20);
            this.txtNBHXH_CS.TabIndex = 222;
            this.txtNBHXH_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNBHXH_CS_KeyDown);
            this.txtNBHXH_CS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtSTBHYT_CS_KeyPress);
            // 
            // txtTTGTBHXH_CS
            // 
            this.txtTTGTBHXH_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtTTGTBHXH_CS.ForeColor = System.Drawing.Color.Black;
            this.txtTTGTBHXH_CS.Location = new System.Drawing.Point(559, 213);
            this.txtTTGTBHXH_CS.Name = "txtTTGTBHXH_CS";
            this.txtTTGTBHXH_CS.Size = new System.Drawing.Size(56, 20);
            this.txtTTGTBHXH_CS.TabIndex = 221;
            this.txtTTGTBHXH_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtTTGTBHXH_CS_KeyDown);
            this.txtTTGTBHXH_CS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtSTBHYT_CS_KeyPress);
            // 
            // txtSTKTBHXH_CS
            // 
            this.txtSTKTBHXH_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtSTKTBHXH_CS.ForeColor = System.Drawing.Color.Black;
            this.txtSTKTBHXH_CS.Location = new System.Drawing.Point(166, 213);
            this.txtSTKTBHXH_CS.Name = "txtSTKTBHXH_CS";
            this.txtSTKTBHXH_CS.Size = new System.Drawing.Size(49, 20);
            this.txtSTKTBHXH_CS.TabIndex = 220;
            this.txtSTKTBHXH_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSTKTBHXH_CS_KeyDown);
            this.txtSTKTBHXH_CS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtSTBHYT_CS_KeyPress);
            // 
            // cboNCBHXH_CS
            // 
            this.cboNCBHXH_CS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboNCBHXH_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboNCBHXH_CS.Location = new System.Drawing.Point(559, 186);
            this.cboNCBHXH_CS.Name = "cboNCBHXH_CS";
            this.cboNCBHXH_CS.Size = new System.Drawing.Size(185, 21);
            this.cboNCBHXH_CS.TabIndex = 219;
            this.cboNCBHXH_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboNCBHXH_CS_KeyDown);
            // 
            // txtSSBHXH_CS
            // 
            this.txtSSBHXH_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtSSBHXH_CS.ForeColor = System.Drawing.Color.Red;
            this.txtSSBHXH_CS.Location = new System.Drawing.Point(166, 186);
            this.txtSSBHXH_CS.MaxLength = 10;
            this.txtSSBHXH_CS.Name = "txtSSBHXH_CS";
            this.txtSSBHXH_CS.Size = new System.Drawing.Size(105, 20);
            this.txtSSBHXH_CS.TabIndex = 217;
            this.txtSSBHXH_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSSBHXH_CS_KeyDown);
            this.txtSSBHXH_CS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtSSBHXH_CS_KeyPress);
            // 
            // txtSDKLD_CS
            // 
            this.txtSDKLD_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtSDKLD_CS.Location = new System.Drawing.Point(162, 124);
            this.txtSDKLD_CS.MaxLength = 15;
            this.txtSDKLD_CS.Name = "txtSDKLD_CS";
            this.txtSDKLD_CS.Size = new System.Drawing.Size(88, 20);
            this.txtSDKLD_CS.TabIndex = 215;
            this.txtSDKLD_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSDKLD_CS_KeyDown);
            // 
            // txtCTCQLD_CS
            // 
            this.txtCTCQLD_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtCTCQLD_CS.Location = new System.Drawing.Point(162, 100);
            this.txtCTCQLD_CS.MaxLength = 50;
            this.txtCTCQLD_CS.Name = "txtCTCQLD_CS";
            this.txtCTCQLD_CS.Size = new System.Drawing.Size(272, 20);
            this.txtCTCQLD_CS.TabIndex = 213;
            this.txtCTCQLD_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCTCQLD_CS_KeyDown);
            this.txtCTCQLD_CS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCTCQLD_CS_KeyPress);
            // 
            // cboTLD_CS
            // 
            this.cboTLD_CS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboTLD_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboTLD_CS.Location = new System.Drawing.Point(610, 76);
            this.cboTLD_CS.Name = "cboTLD_CS";
            this.cboTLD_CS.Size = new System.Drawing.Size(160, 21);
            this.cboTLD_CS.TabIndex = 212;
            this.cboTLD_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboTLD_CS_KeyDown);
            // 
            // txtNCapLD_CS
            // 
            this.txtNCapLD_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNCapLD_CS.Location = new System.Drawing.Point(162, 76);
            this.txtNCapLD_CS.MaxLength = 50;
            this.txtNCapLD_CS.Name = "txtNCapLD_CS";
            this.txtNCapLD_CS.Size = new System.Drawing.Size(192, 20);
            this.txtNCapLD_CS.TabIndex = 211;
            this.txtNCapLD_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNCapLD_CS_KeyDown);
            this.txtNCapLD_CS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtNCapLD_CS_KeyPress);
            // 
            // txtSSLD_CS
            // 
            this.txtSSLD_CS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtSSLD_CS.ForeColor = System.Drawing.Color.Red;
            this.txtSSLD_CS.Location = new System.Drawing.Point(162, 52);
            this.txtSSLD_CS.MaxLength = 15;
            this.txtSSLD_CS.Name = "txtSSLD_CS";
            this.txtSSLD_CS.Size = new System.Drawing.Size(112, 20);
            this.txtSSLD_CS.TabIndex = 209;
            this.txtSSLD_CS.Validated += new System.EventHandler(this.txtNCBHXH_CS_Validated);
            this.txtSSLD_CS.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSSLD_CS_KeyDown);
            this.txtSSLD_CS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtSSLD_CS_KeyPress);
            // 
            // label109
            // 
            this.label109.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label109.ForeColor = System.Drawing.Color.DarkBlue;
            this.label109.Location = new System.Drawing.Point(391, 345);
            this.label109.Name = "label109";
            this.label109.Size = new System.Drawing.Size(76, 14);
            this.label109.TabIndex = 208;
            this.label109.Text = "BH nhân thọ ";
            this.label109.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label108
            // 
            this.label108.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label108.ForeColor = System.Drawing.Color.DarkBlue;
            this.label108.Location = new System.Drawing.Point(579, 349);
            this.label108.Name = "label108";
            this.label108.Size = new System.Drawing.Size(54, 14);
            this.label108.TabIndex = 207;
            this.label108.Text = "BH khác ";
            this.label108.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label107
            // 
            this.label107.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label107.ForeColor = System.Drawing.Color.DarkBlue;
            this.label107.Location = new System.Drawing.Point(385, 321);
            this.label107.Name = "label107";
            this.label107.Size = new System.Drawing.Size(82, 14);
            this.label107.TabIndex = 206;
            this.label107.Text = "Tại bệnh viện ";
            this.label107.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label106
            // 
            this.label106.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label106.ForeColor = System.Drawing.Color.DarkBlue;
            this.label106.Location = new System.Drawing.Point(561, 295);
            this.label106.Name = "label106";
            this.label106.Size = new System.Drawing.Size(25, 13);
            this.label106.TabIndex = 205;
            this.label106.Text = "Tại ";
            this.label106.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label104
            // 
            this.label104.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label104.ForeColor = System.Drawing.Color.DarkBlue;
            this.label104.Location = new System.Drawing.Point(257, 321);
            this.label104.Name = "label104";
            this.label104.Size = new System.Drawing.Size(29, 13);
            this.label104.TabIndex = 203;
            this.label104.Text = "đến ";
            this.label104.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label102
            // 
            this.label102.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label102.ForeColor = System.Drawing.Color.DarkBlue;
            this.label102.Location = new System.Drawing.Point(92, 320);
            this.label102.Name = "label102";
            this.label102.Size = new System.Drawing.Size(64, 13);
            this.label102.TabIndex = 201;
            this.label102.Text = "Thời hạn từ ";
            this.label102.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label101
            // 
            this.label101.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label101.ForeColor = System.Drawing.Color.DarkBlue;
            this.label101.Location = new System.Drawing.Point(117, 297);
            this.label101.Name = "label101";
            this.label101.Size = new System.Drawing.Size(41, 13);
            this.label101.TabIndex = 200;
            this.label101.Text = "Số thẻ ";
            this.label101.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label97
            // 
            this.label97.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label97.ForeColor = System.Drawing.Color.DarkBlue;
            this.label97.Location = new System.Drawing.Point(422, 217);
            this.label97.Name = "label97";
            this.label97.Size = new System.Drawing.Size(130, 13);
            this.label97.TabIndex = 196;
            this.label97.Text = "Tổng thời gian tính BHXH";
            this.label97.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label88
            // 
            this.label88.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label88.ForeColor = System.Drawing.Color.DarkBlue;
            this.label88.Location = new System.Drawing.Point(462, 128);
            this.label88.Name = "label88";
            this.label88.Size = new System.Drawing.Size(136, 13);
            this.label88.TabIndex = 190;
            this.label88.Text = "Ngày ĐK sử dụng lao động";
            this.label88.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label89
            // 
            this.label89.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label89.ForeColor = System.Drawing.Color.DarkBlue;
            this.label89.Location = new System.Drawing.Point(528, 104);
            this.label89.Name = "label89";
            this.label89.Size = new System.Drawing.Size(73, 13);
            this.label89.TabIndex = 189;
            this.label89.Text = "Ngày chuyển ";
            this.label89.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label90
            // 
            this.label90.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label90.ForeColor = System.Drawing.Color.DarkBlue;
            this.label90.Location = new System.Drawing.Point(572, 78);
            this.label90.Name = "label90";
            this.label90.Size = new System.Drawing.Size(31, 13);
            this.label90.TabIndex = 188;
            this.label90.Text = "Tỉnh ";
            this.label90.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label87
            // 
            this.label87.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label87.ForeColor = System.Drawing.Color.DarkBlue;
            this.label87.Location = new System.Drawing.Point(96, 128);
            this.label87.Name = "label87";
            this.label87.Size = new System.Drawing.Size(55, 13);
            this.label87.TabIndex = 186;
            this.label87.Text = "Số ĐKLĐ ";
            this.label87.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label80
            // 
            this.label80.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label80.ForeColor = System.Drawing.Color.DarkBlue;
            this.label80.Location = new System.Drawing.Point(114, 55);
            this.label80.Name = "label80";
            this.label80.Size = new System.Drawing.Size(37, 13);
            this.label80.TabIndex = 183;
            this.label80.Text = "Số sổ ";
            this.label80.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label84
            // 
            this.label84.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label84.ForeColor = System.Drawing.Color.DarkBlue;
            this.label84.Location = new System.Drawing.Point(104, 78);
            this.label84.Name = "label84";
            this.label84.Size = new System.Drawing.Size(47, 13);
            this.label84.TabIndex = 184;
            this.label84.Text = "Nơi cấp ";
            this.label84.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label91
            // 
            this.label91.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label91.ForeColor = System.Drawing.Color.DarkBlue;
            this.label91.Location = new System.Drawing.Point(546, 56);
            this.label91.Name = "label91";
            this.label91.Size = new System.Drawing.Size(56, 13);
            this.label91.TabIndex = 187;
            this.label91.Text = "Ngày cấp ";
            this.label91.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label86
            // 
            this.label86.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label86.ForeColor = System.Drawing.Color.DarkBlue;
            this.label86.Location = new System.Drawing.Point(46, 104);
            this.label86.Name = "label86";
            this.label86.Size = new System.Drawing.Size(101, 13);
            this.label86.TabIndex = 185;
            this.label86.Text = "Chuyển từ Cơ quan ";
            this.label86.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label105
            // 
            this.label105.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label105.ForeColor = System.Drawing.Color.DarkBlue;
            this.label105.Location = new System.Drawing.Point(407, 295);
            this.label105.Name = "label105";
            this.label105.Size = new System.Drawing.Size(60, 14);
            this.label105.TabIndex = 204;
            this.label105.Text = "Ngày cấp ";
            this.label105.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label103
            // 
            this.label103.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label103.ForeColor = System.Drawing.Color.DarkBlue;
            this.label103.Location = new System.Drawing.Point(85, 345);
            this.label103.Name = "label103";
            this.label103.Size = new System.Drawing.Size(76, 14);
            this.label103.TabIndex = 202;
            this.label103.Text = "BHTN 24/24 ";
            this.label103.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label99
            // 
            this.label99.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label99.ForeColor = System.Drawing.Color.DarkBlue;
            this.label99.Location = new System.Drawing.Point(705, 217);
            this.label99.Name = "label99";
            this.label99.Size = new System.Drawing.Size(35, 14);
            this.label99.TabIndex = 198;
            this.label99.Text = "tháng";
            this.label99.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label95
            // 
            this.label95.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label95.ForeColor = System.Drawing.Color.DarkBlue;
            this.label95.Location = new System.Drawing.Point(303, 190);
            this.label95.Name = "label95";
            this.label95.Size = new System.Drawing.Size(60, 14);
            this.label95.TabIndex = 194;
            this.label95.Text = "Ngày cấp ";
            this.label95.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label93
            // 
            this.label93.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label93.ForeColor = System.Drawing.Color.DarkBlue;
            this.label93.Location = new System.Drawing.Point(116, 190);
            this.label93.Name = "label93";
            this.label93.Size = new System.Drawing.Size(39, 14);
            this.label93.TabIndex = 192;
            this.label93.Text = "Số sổ ";
            this.label93.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label96
            // 
            this.label96.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label96.ForeColor = System.Drawing.Color.DarkBlue;
            this.label96.Location = new System.Drawing.Point(504, 190);
            this.label96.Name = "label96";
            this.label96.Size = new System.Drawing.Size(50, 13);
            this.label96.TabIndex = 195;
            this.label96.Text = "Nơi cấp ";
            this.label96.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label94
            // 
            this.label94.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label94.ForeColor = System.Drawing.Color.DarkBlue;
            this.label94.Location = new System.Drawing.Point(10, 217);
            this.label94.Name = "label94";
            this.label94.Size = new System.Drawing.Size(145, 14);
            this.label94.TabIndex = 193;
            this.label94.Text = "Số tháng không tính BHXH ";
            this.label94.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label98
            // 
            this.label98.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label98.ForeColor = System.Drawing.Color.DarkBlue;
            this.label98.Location = new System.Drawing.Point(620, 217);
            this.label98.Name = "label98";
            this.label98.Size = new System.Drawing.Size(32, 14);
            this.label98.TabIndex = 197;
            this.label98.Text = "năm ";
            this.label98.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label100
            // 
            this.label100.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label100.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label100.Location = new System.Drawing.Point(10, 261);
            this.label100.Name = "label100";
            this.label100.Size = new System.Drawing.Size(741, 23);
            this.label100.TabIndex = 199;
            this.label100.Text = "BẢO HIỂM Y TẾ";
            this.label100.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // label92
            // 
            this.label92.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label92.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label92.Location = new System.Drawing.Point(6, 157);
            this.label92.Name = "label92";
            this.label92.Size = new System.Drawing.Size(762, 23);
            this.label92.TabIndex = 191;
            this.label92.Text = "SỔ BẢO HIỂM XÃ HỘI";
            this.label92.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // label79
            // 
            this.label79.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label79.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label79.Location = new System.Drawing.Point(21, 14);
            this.label79.Name = "label79";
            this.label79.Size = new System.Drawing.Size(730, 23);
            this.label79.TabIndex = 182;
            this.label79.Text = "SỔ LAO ĐỘNG";
            this.label79.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // dtpNgayCongTac
            // 
            this.dtpNgayCongTac.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtpNgayCongTac.Location = new System.Drawing.Point(649, 454);
            this.dtpNgayCongTac.Mask = "##/##/####";
            this.dtpNgayCongTac.Name = "dtpNgayCongTac";
            this.dtpNgayCongTac.Size = new System.Drawing.Size(80, 23);
            this.dtpNgayCongTac.TabIndex = 235;
            this.dtpNgayCongTac.Text = "__/__/____";
            // 
            // txtTSo
            // 
            this.txtTSo.Enabled = false;
            this.txtTSo.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtTSo.ForeColor = System.Drawing.Color.Red;
            this.txtTSo.Location = new System.Drawing.Point(74, 454);
            this.txtTSo.Name = "txtTSo";
            this.txtTSo.Size = new System.Drawing.Size(64, 22);
            this.txtTSo.TabIndex = 232;
            this.txtTSo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            this.txtTSo.Visible = false;
            this.txtTSo.WordWrap = false;
            // 
            // label27
            // 
            this.label27.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label27.ForeColor = System.Drawing.Color.Blue;
            this.label27.Location = new System.Drawing.Point(12, 454);
            this.label27.Name = "label27";
            this.label27.Size = new System.Drawing.Size(56, 24);
            this.label27.TabIndex = 234;
            this.label27.Text = "Tổng  Số ";
            this.label27.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.label27.Visible = false;
            // 
            // panButLyLich
            // 
            this.panButLyLich.Controls.Add(this.btnSua);
            this.panButLyLich.Controls.Add(this.butThem);
            this.panButLyLich.Controls.Add(this.butHuy);
            this.panButLyLich.Controls.Add(this.butKetThuc);
            this.panButLyLich.Location = new System.Drawing.Point(238, 434);
            this.panButLyLich.Name = "panButLyLich";
            this.panButLyLich.Size = new System.Drawing.Size(306, 48);
            this.panButLyLich.TabIndex = 233;
            // 
            // btnSua
            // 
            this.btnSua.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnSua.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.btnSua.Image = global::Human.Properties.Resources.quick_edit;
            this.btnSua.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnSua.Location = new System.Drawing.Point(86, 8);
            this.btnSua.Name = "btnSua";
            this.btnSua.Size = new System.Drawing.Size(65, 28);
            this.btnSua.TabIndex = 8;
            this.btnSua.Text = "   &Sửa";
            this.toolTip1.SetToolTip(this.btnSua, "Alt+S");
            this.btnSua.UseVisualStyleBackColor = true;
            this.btnSua.Click += new System.EventHandler(this.btnSua_Click);
            // 
            // butThem
            // 
            this.butThem.BackColor = System.Drawing.SystemColors.Control;
            this.butThem.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butThem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.butThem.Image = ((System.Drawing.Image)(resources.GetObject("butThem.Image")));
            this.butThem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butThem.Location = new System.Drawing.Point(14, 8);
            this.butThem.Name = "butThem";
            this.butThem.Size = new System.Drawing.Size(66, 28);
            this.butThem.TabIndex = 0;
            this.butThem.Text = "  &Lưu";
            this.toolTip1.SetToolTip(this.butThem, "Alt+L");
            this.butThem.UseVisualStyleBackColor = true;
            this.butThem.Click += new System.EventHandler(this.butThem_Click);
            // 
            // butHuy
            // 
            this.butHuy.BackColor = System.Drawing.SystemColors.Control;
            this.butHuy.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butHuy.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.butHuy.Image = ((System.Drawing.Image)(resources.GetObject("butHuy.Image")));
            this.butHuy.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butHuy.Location = new System.Drawing.Point(157, 8);
            this.butHuy.Name = "butHuy";
            this.butHuy.Size = new System.Drawing.Size(65, 28);
            this.butHuy.TabIndex = 4;
            this.butHuy.Text = "  &Hủy";
            this.toolTip1.SetToolTip(this.butHuy, "Alt+H");
            this.butHuy.UseVisualStyleBackColor = true;
            this.butHuy.Click += new System.EventHandler(this.butHuy_Click);
            // 
            // butKetThuc
            // 
            this.butKetThuc.BackColor = System.Drawing.SystemColors.Control;
            this.butKetThuc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butKetThuc.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.butKetThuc.Image = global::Human.Properties.Resources.close_r;
            this.butKetThuc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butKetThuc.Location = new System.Drawing.Point(228, 7);
            this.butKetThuc.Name = "butKetThuc";
            this.butKetThuc.Size = new System.Drawing.Size(75, 28);
            this.butKetThuc.TabIndex = 7;
            this.butKetThuc.Text = "&Kết thúc";
            this.butKetThuc.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.toolTip1.SetToolTip(this.butKetThuc, "Alt+K");
            this.butKetThuc.UseVisualStyleBackColor = true;
            this.butKetThuc.Click += new System.EventHandler(this.butKetThuc_Click);
            // 
            // frmCapSo
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(794, 690);
            this.Controls.Add(this.grouphienthi);
            this.Controls.Add(this.lblTenPhongCT);
            this.Controls.Add(this.lblHoTenNVCT);
            this.Controls.Add(this.label29);
            this.Controls.Add(this.lblMasoNVCT);
            this.Controls.Add(this.label28);
            this.Controls.Add(this.toolStrip3);
            this.Controls.Add(this.dtpNgayCongTac);
            this.Controls.Add(this.panButLyLich);
            this.Controls.Add(this.txtTSo);
            this.Controls.Add(this.label27);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.Name = "frmCapSo";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Hồ sơ nhân viên";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.Load += new System.EventHandler(this.frmCapSoSua_Load);
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.frmCapSo_KeyDown);
            this.toolStrip3.ResumeLayout(false);
            this.toolStrip3.PerformLayout();
            this.grouphienthi.ResumeLayout(false);
            this.grouphienthi.PerformLayout();
            this.panButLyLich.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion


		private void load_LBL(string v_manv,string v_ho,string v_bophan)
		{
			try
			{
				v_manv=get_llnvmanv;
				v_ho=get_llnvmanv1;
				v_bophan=get_llnvmanv2;
				if (lblMasoNVCT.Text.Trim()=="".ToString())
				{
					lblMasoNVCT.Text="00000";					
				}
				else
				{
					lblMasoNVCT.Text=v_manv;
					lblHoTenNVCT.Text=v_ho;
					lblTenPhongCT.Text=v_bophan;
					load_LBL();								
				}
			}
			catch{}			
		}

		private void themnhanvien()
		{	
			try
			{
				insertCS();	
				butKetThuc.Focus();
			}
			catch{}
		}
		private void loadCapso()
		{
			try
			{
				string ma_nv=lblMasoNVCT.Text;				
				DataSet ds=mDB.LyLichNV(ma_nv);
				DataRow []r=ds.Tables[0].Select("manv='"+ma_nv+"'");
                DataSet ds1 = mDB.get_hopdong(ma_nv);
				DataRow []r1=ds1.Tables[0].Select("manv='"+ma_nv+"'");				

				if(ds1.Tables[0].Rows.Count>0)
				{
					txtCTCQLD_CS.Text=r1[0]["sld_tudau"].ToString();
					txtNChuyenLD_CS.Text=r1[0]["m_sld_ngaydi"].ToString();
					txtSSBHXH_CS.Text=r1[0]["sobhxh"].ToString();
					txtSTKTBHXH_CS.Text=r1[0]["k_tinhbhxh"].ToString();                   
                 
				}
                if (ds1.Tables[0].Rows.Count > 0)
                {
                    string t = r1[0]["m_ngaybhxh"].ToString();
                    if (t != "")
                    {
                        DateTime n_bhxh = Convert.ToDateTime(mDB.StringToMMDDYYYY(r1[0]["m_ngaybhxh"].ToString()));
                        int thang = 0, nam = 0, thang_ht = 0, nam_ht = 0, tong_thang = 0, t1 = 0, t2 = 0;
                        thang = int.Parse(n_bhxh.Month.ToString());
                        nam = int.Parse(n_bhxh.Year.ToString());
                        thang_ht = int.Parse(DateTime.Now.Month.ToString());
                        nam_ht = int.Parse(DateTime.Now.Year.ToString());
                        if (thang_ht < thang)
                        {
                            thang = thang_ht + 12 - thang;
                            nam = nam_ht - 1 - nam;
                        }
                        else
                        {
                            thang = thang_ht - thang;
                            nam = nam_ht - nam;
                        }
                        tong_thang = thang + nam * 12 - int.Parse(txtSTKTBHXH_CS.Text.Trim());
                        t2 = tong_thang / 12;
                        t1 = tong_thang % 12;
                        txtTTGTBHXH_CS.Text = t2.ToString();
                        txtNBHXH_CS.Text = t1.ToString();
                    }
                    else
                    {
                        txtTTGTBHXH_CS.Text = "0";
                        txtNBHXH_CS.Text = "0";
                    }
                }
				if(ds.Tables[0].Rows.Count>0)
				{
					txtSSLD_CS.Text=r[0]["sold"].ToString();
					txtNCLD_CS.Text=r[0]["ngay_sold"].ToString();
					txtNCapLD_CS.Text=r[0]["huyensld"].ToString();				
					cboTLD_CS.SelectedValue=r[0]["tinhsld"].ToString();				
					txtSDKLD_CS.Text=r[0]["dkldso"].ToString();
					txtNDKSDLD_CS.Text=r[0]["ngay_dkld"].ToString();				
					txtNCBHXH_CS.Text=r[0]["ngay_cap"].ToString();
					cboNCBHXH_CS.SelectedValue=r[0]["matinhbhxh"].ToString();                   
				}
                sql = "select manv,sobhyt,";
                sql += " to_char(ngaycap,'dd/mm/yyyy') as ngay_cap,captai,";
                sql += " to_char(thoihan,'dd/mm/yyyy') as thoi_han,";
                sql += " to_char(denhan,'dd/mm/yyyy') as den_han,";
                sql += " tai_bvien,bhtn,bhnhantho,bhkhac ";
                sql+=" from  "+m_user+".thebhyt  where manv ='" + ma_nv + "'";
				DataSet ds2=mDB.get_data(sql);   
				DataRow []r2=ds2.Tables[0].Select("manv='"+ma_nv+"'");
				if(ds2.Tables[0].Rows.Count>0)
				{
					txtSTBHYT_CS.Text=r2[0]["sobhyt"].ToString();
					txtNCBHYT_CS.Text=r2[0]["ngay_cap"].ToString();
					cboTBHYT_CS.SelectedValue=r2[0]["captai"].ToString();
					txtTHTBHYT_CS.Text=r2[0]["thoi_han"].ToString();
					txtDBHYT_CS.Text=r2[0]["den_han"].ToString();
					cboTBVBHYT_CS.SelectedValue=r2[0]["tai_bvien"].ToString();
					cboBHTN24BHYT_CS.SelectedValue=r2[0]["bhtn"].ToString();
					cboBHNTBHYT_CS.SelectedValue=r2[0]["bhnhantho"].ToString();
					cboBHKBHYT_CS.SelectedValue=r2[0]["bhkhac"].ToString();
				}	
			}
			catch(Exception ex)			
			{
				MessageBox.Show(ex.ToString());
			}
		}

		private void insertCS()
		{
			string ma_nv,ss_ld,nc_ld,t_ld,noic_ld,sdkld_ld,ndksdld_ld,nc_bhxh,noic_bhxh;			
			
			ma_nv=lblMasoNVCT.Text;
			ss_ld=txtSSLD_CS.Text;
			nc_ld=(txtNCLD_CS.Text=="  /  /")?"":txtNCLD_CS.Text;
			noic_ld=txtNCapLD_CS.Text;
			t_ld=(cboTLD_CS.SelectedIndex==-1)?"":cboTLD_CS.SelectedValue.ToString();
			sdkld_ld=txtSDKLD_CS.Text;

            ndksdld_ld = (txtNDKSDLD_CS.Text == "  /  /") ? "" : txtNDKSDLD_CS.Text;
            nc_bhxh = (txtNCBHXH_CS.Text == "  /  /") ? "" : txtNCBHXH_CS.Text;
			noic_bhxh=(cboNCBHXH_CS.SelectedIndex==-1)?"":cboNCBHXH_CS.SelectedValue.ToString();

			mDB.upd_lylichnvCS(ma_nv,ss_ld,nc_ld,t_ld,noic_ld,sdkld_ld,ndksdld_ld,nc_bhxh,noic_bhxh);

			string ctcq_ld,nchuyen_ld,s_bhxh;
			int stktbhxh_bhxh;
			decimal tg1,tg2,tgbhxh_bhxh;
			
			ctcq_ld=txtCTCQLD_CS.Text;
			nchuyen_ld=(txtNChuyenLD_CS.Text=="  /  /")?"":txtNChuyenLD_CS.Text;
			s_bhxh=txtSSBHXH_CS.Text;
			stktbhxh_bhxh=(txtSTKTBHXH_CS.Text.ToString()=="")?0:int.Parse(txtSTKTBHXH_CS.Text.ToString());
			tg1=decimal.Parse(txtTTGTBHXH_CS.Text.Trim());
			tg2=decimal.Parse(txtNBHXH_CS.Text.Trim());
			tgbhxh_bhxh=tg1*12+tg2;
			
			mDB.upd_hopdongCS(ma_nv,s_bhxh,stktbhxh_bhxh,ctcq_ld,nchuyen_ld,tgbhxh_bhxh);

			string st_bhyt,nc_bhyt,t_bhyt,tht_bhyt,d_bhyt,tbv_bhyt,
				bhtn24_bhyt,bhnt_bhyt,bhk_bhyt;
			
			st_bhyt=txtSTBHYT_CS.Text;
            nc_bhyt = (txtNCBHYT_CS.Text == "  /  /") ? "" : txtNCBHYT_CS.Text;
			t_bhyt=(cboTBHYT_CS.SelectedIndex==-1)?"":cboTBHYT_CS.SelectedValue.ToString();
			tht_bhyt=(txtTHTBHYT_CS.Text=="  /  /")?"":txtTHTBHYT_CS.Text;
            d_bhyt = (txtDBHYT_CS.Text == "  /  /") ? "" : txtDBHYT_CS.Text;
			tbv_bhyt=(cboTBVBHYT_CS.SelectedIndex==-1)?"":cboTBVBHYT_CS.SelectedValue.ToString();
			bhtn24_bhyt=(cboBHTN24BHYT_CS.SelectedIndex==-1)?"":cboBHTN24BHYT_CS.SelectedValue.ToString();
			bhnt_bhyt=(cboBHNTBHYT_CS.SelectedIndex==-1)?"":cboBHNTBHYT_CS.SelectedValue.ToString();
			bhk_bhyt=(cboBHKBHYT_CS.SelectedIndex==-1)?"":cboBHKBHYT_CS.SelectedValue.ToString();

			mDB.upd_BaohiemYteCS(ma_nv,st_bhyt,nc_bhyt,t_bhyt,tht_bhyt,d_bhyt,tbv_bhyt,bhtn24_bhyt,bhnt_bhyt,bhk_bhyt);
		}
		private void butThem_Click(object sender, System.EventArgs e)
		{
			try
			{
				themnhanvien();											
				tongso();
				butKetThuc.Focus();
			}
			catch{}
            setcontrol(false);
            btnSua.Enabled = admin;
            butHuy.Enabled = admin;
            butThem.Enabled = false;
		}
		public void tongso()
		{
			try
			{
				ds=mDB.f_countNV();
				TSo=ds.Tables[0].Rows[0][0].ToString();
				txtTSo.Text="";
				txtTSo.Text=TSo.ToString();
			}
			catch{}
		}
		public string get_llnvmanv
		{
			get
			{
				v_manv=lblMasoNVCT.Text.ToString();				
				return v_manv;
			}
		}
		public string get_llnvmanv1
		{
			get
			{	
				v_ho=lblHoTenNVCT.Text.ToString();
				return v_ho;
			}
		}
		public string get_llnvmanv2
		{
			get
			{				
				v_bophan=lblTenPhongCT.Text.ToString();
				return v_bophan;
			}
		}
		private bool IsNumeric (string strNum)
		{	
			int iNum;
			try
			{
				iNum = int.Parse(strNum);
				return true;
			}
			catch
			{
				return false;
			}
		}
		private int kiemtrangay(int dtemp,int y)
		{
			return DateTime.DaysInMonth(y,dtemp);
		}
		private void load_LBL()
		{	
			string ma_nv1=lblMasoNVCT.Text.ToString();
			string ho_nv=lblHoTenNVCT.Text.ToString();
			string bophan_nv=lblTenPhongCT.Text.ToString();
            sql = "SELECT l.manv,l.mnvmay,l.ho||' '||l.ten as ho_t,b.tenbp FROM " + m_user + ".llnv l," + m_user + ".bophan b ";
            sql += " where l.manv ='" + ma_nv1 + "' and l.madv=b.madv ";			
			DataSet ads=mDB.get_data(sql);
			DataRow[] r=ads.Tables[0].Select("manv='" + ma_nv1+"'");							
			if(lblMasoNVCT.Text.Trim()=="")
			{
				lblMasoNVCT.Text="00000".ToString();
				goicb();				
			}
			else 
			{
				lblMasoNVCT.Text=v_manv;
				lblHoTenNVCT.Text=v_ho;
				lblTenPhongCT.Text=v_bophan;
				loadCapso(v_manv,v_ho,v_bophan);	
			}						
		}

		private void loadCapso(string v_manv,string v_ho,string v_bophan)
		{
			try
			{
				v_manv=get_llnvmanv;
				v_ho=get_llnvmanv1;
				v_bophan=get_llnvmanv2;
				if (lblMasoNVCT.Text.Trim()=="".ToString())
				{
					lblMasoNVCT.Text="00000";					
				}
				else
				{
					lblMasoNVCT.Text=v_manv;
					lblHoTenNVCT.Text=v_ho;
					lblTenPhongCT.Text=v_bophan;
					loadCapso();
				}
			}
			catch{}		
		}
		private void Load_capso()
		{
            
			Tinh_CSLD();//tỉnh cấp sổ lao động
			NoicapsoBHXH();
			NoicapsoBHYT();
			Benhvien_CS();
			Bh1();
			Bh2();
			Bh3();
            loadCapso();
		}        
		private void goicb()
		{		
			txtSSLD_CS.Text="";txtNCLD_CS.Text="";
			txtNCapLD_CS.Text="";cboTLD_CS.SelectedIndex=-1;
			txtCTCQLD_CS.Text="";txtNChuyenLD_CS.Text="";
			txtSDKLD_CS.Text="";txtNDKSDLD_CS.Text="";
			txtSSBHXH_CS.Text="";txtNCBHXH_CS.Text="";cboNCBHXH_CS.SelectedIndex=-1;
			txtSTKTBHXH_CS.Text="";txtTTGTBHXH_CS.Text="";txtNBHXH_CS.Text="";
			txtSTBHYT_CS.Text="";txtNCBHYT_CS.Text="";cboTBHYT_CS.SelectedIndex=-1;
			txtTHTBHYT_CS.Text="";txtDBHYT_CS.Text="";cboTBVBHYT_CS.SelectedIndex=-1;
			cboBHTN24BHYT_CS.SelectedIndex=-1;cboBHNTBHYT_CS.SelectedIndex=-1;cboBHKBHYT_CS.SelectedIndex=-1;			
		}

		private void butHuy_Click(object sender, System.EventArgs e)
		{
			DataSet ds=new DataSet();
			string ma_nv=lblMasoNVCT.Text;
			DialogResult dr = MessageBox.Show(lan.Change_language_MessageText("Đồng ý huỷ thông tin này"),AccessData.Msg,MessageBoxButtons.YesNo);			
			if(dr == DialogResult.Yes) 			
			{	
				try
				{
                    mDB.Execute_data("DELETE  FROM " + m_user + ".thebhyt WHERE manv='" + ma_nv + "'");// .f_Del3(ma_nv);//tabcapso thebaohiemyte
					mDB.DelCSllnv(ma_nv);
					mDB.DelCShd(ma_nv);
					MessageBox.Show(lan.Change_language_MessageText("Đã Hủy"));
                    butHuy.Enabled = false;
                    butThem.Enabled = true;
					ds=mDB.f_countNV();
					TSo=ds.Tables[0].Rows[0][0].ToString();
					txtTSo.Text="";
					txtTSo.Text=TSo.ToString();
					goicb();					
				}
				catch {}
			}			
			else
			{	
				MessageBox.Show(lan.Change_language_MessageText("Không Có Hủy"));	
			}
		}

		private void txtSSLD_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtSSLD_CS_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
            if (e.KeyChar == 8)
                e.Handled = false;
		}

		private void txtNCLD_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}
	
		private void txtNCapLD_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void txtNCapLD_CS_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void cboTLD_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				txtCTCQLD_CS.Focus();
		}

		private void txtCTCQLD_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtCTCQLD_CS_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtNChuyenLD_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
                SendKeys.Send("{Tab}");
		}
	
		private void txtSDKLD_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}
		
		private void txtNDKSDLD_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtNDKSDLD_CS_Validated(object sender, System.EventArgs e)
		{
            txtNDKSDLD_CS.Text = txtNDKSDLD_CS.Text.Trim();
            if (txtNDKSDLD_CS.Text == "  /  /") return;
            if (!mDB.kiemtrangayhople(txtNDKSDLD_CS.Text.Trim()))
            {
                txtNDKSDLD_CS.Focus();
                return;

            }
		}

		private void txtSSBHXH_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtSSBHXH_CS_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar==8)
				e.Handled=false;
		}

		private void txtNCBHXH_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void txtNCBHXH_CS_Validated(object sender, System.EventArgs e)
		{
			string ma_nv2=lblMasoNVCT.Text;
			DataSet dshd=new DataSet();
			dshd=mDB.LyLichNVhd(lblMasoNVCT.Text);							
			DataRow[] rhd=dshd.Tables[0].Select("manv= '"+ma_nv2+"'");
            dtpNgayCongTac.Text=rhd[0]["m_ngaydenct"].ToString();
            txtNCBHXH_CS.Text = txtNCBHXH_CS.Text.Trim();
            if (txtNCBHXH_CS.Text == "  /  /")
                return;
			if(txtNCBHXH_CS.Text!="" )
			{
				if(!mDB.kiemtrangayhople(txtNCBHXH_CS.Text.Trim()))
				{
                    MessageBox.Show(lan.Change_language_MessageText("Nhập ngày không hợp lệ"),AccessData.Msg,MessageBoxButtons.OK,MessageBoxIcon.Warning);
					txtNCBHXH_CS.Focus();
					return ;
				}
				int ddns=0,mmns=0,yyns=0;				
				try
				{					
					ddns=int.Parse(txtNCBHXH_CS.Text.Substring(0,2));
					mmns=int.Parse(txtNCBHXH_CS.Text.Substring(3,2));
					yyns=int.Parse(txtNCBHXH_CS.Text.Substring(6,4));
				}
				catch{}

				int dd=0,mm=0,yy=0;				
				try
				{					
					dd=int.Parse(dtpNgayCongTac.Text.Substring(0,2));
					mm=int.Parse(dtpNgayCongTac.Text.Substring(3,2));
					yy=int.Parse(dtpNgayCongTac.Text.Substring(6,4));
				}
				catch{}
                /*
				try
				{					
					if(yyns<yy)
					{
						MessageBox.Show("Năm của ngày công tác " + dtpNgayCongTac.Text + " phải nhỏ hơn năm của ngày cấp BHXH","Thông Báo");
						txtNCBHXH_CS.Focus();
						return;
					}					
					if(yyns==yy)
					{
						if(mmns<mm)
						{
							MessageBox.Show("Tháng của ngày công tác " + dtpNgayCongTac.Text + " phải nhỏ hơn tháng của ngày cấp BHXH","Thông Báo");
							txtNCBHXH_CS.Focus();
							return;
						}
						if(mmns==mm)
						{
							if(ddns<dd)
							{
								MessageBox.Show("Ngày của ngày công tác " + dtpNgayCongTac.Text + " phải nhỏ hơn ngày cấp BHXH","Thông Báo");
								txtNCBHXH_CS.Focus();
								return;
							}
						}
					}
				}
				catch{}				*/
			}
			cboNCBHXH_CS.SelectedValue=mDB.Mabv.Substring(0,3);
			SendKeys.Send("{F4}");
		}

		private void cboNCBHXH_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				txtSTKTBHXH_CS.Focus();
		}

		private void txtSTKTBHXH_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtTTGTBHXH_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtNBHXH_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtSTBHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtSTBHYT_CS_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
		}
		private void txtNCBHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
			{
				
				SendKeys.Send("{Tab}{F4}");
			}
		}

		private void txtNCBHYT_CS_Validated(object sender, System.EventArgs e)
		{
            txtNCBHXH_CS.Text = txtNCBHXH_CS.Text.Trim();
            if (txtNCBHXH_CS.Text == "  /  /") return;
            if(!mDB.kiemtrangayhople(txtNCBHYT_CS.Text.Trim()))
			{
				cboTBHYT_CS.Focus();
				return ;
			}
			cboTBHYT_CS.SelectedValue=mDB.Mabv.Substring(0,3);
			SendKeys.Send("{F4}");
		}

		private void cboTBHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				txtTHTBHYT_CS.Focus();
		}

		private void txtTHTBHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void txtDBHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}
		private void cboTBVBHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
			{
				cboBHTN24BHYT_CS.Focus();
				SendKeys.Send("{F4}");
			}
		}

		private void cboBHTN24BHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
			{
				cboBHNTBHYT_CS.Focus();
				SendKeys.Send("{F4}");
			}
		}

		private void cboBHNTBHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
			{
				cboBHKBHYT_CS.Focus();
				SendKeys.Send("{F4}");
			}
		}

		private void cboBHKBHYT_CS_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				butThem.Focus();
		}

		private void frmCapSoSua_Load(object sender, System.EventArgs e)
		{
			dtpNgayCongTac.Hide();
			Load_capso();
            if (txtSTBHYT_CS.Text.Trim().Equals("") && txtSSBHXH_CS.Text.Equals("") && txtSSLD_CS.Text.Equals(""))
            {
                setcontrol(true);
                btnSua.Enabled = admin;
                butHuy.Enabled = admin;
                //butThem.Enabled = false;
            }
            else
            {
                setcontrol(false);
                btnSua.Enabled = admin;
                butHuy.Enabled = admin;
                butThem.Enabled = false;
            }
		}

        public void setcontrol(bool av)
        {
            grouphienthi.Enabled = av;
            btnSua.Enabled = !av;
            butHuy.Enabled = !av;
        }
		private void Tinh_CSLD()
		{
			cboTLD_CS.DisplayMember="tentt";
			cboTLD_CS.ValueMember="matt";
			cboTLD_CS.DataSource=mDB.get_tinhthanh().Tables[0];
			cboTLD_CS.SelectedIndex=-1;
		}
		private void NoicapsoBHXH()
		{
			cboNCBHXH_CS.DisplayMember="tentt";
			cboNCBHXH_CS.ValueMember="matt";
            cboNCBHXH_CS.DataSource = mDB.get_tinhthanh().Tables[0];
			cboNCBHXH_CS.SelectedIndex=-1;
		}
		private void NoicapsoBHYT()
		{
			cboTBHYT_CS.DisplayMember="tentt";
			cboTBHYT_CS.ValueMember="matt";
            cboTBHYT_CS.DataSource = mDB.get_tinhthanh().Tables[0];
			cboTBHYT_CS.SelectedIndex=-1;
		}
		private void Benhvien_CS()
		{
			cboTBVBHYT_CS.DisplayMember="tenbv";
			cboTBVBHYT_CS.ValueMember="mabv";
            cboTBVBHYT_CS.DataSource = mDB.get_benhvien().Tables[0];
			cboTBVBHYT_CS.SelectedIndex=-1;
		}
		private void Bh1()
		{
			cboBHTN24BHYT_CS.DisplayMember="ten";
			cboBHTN24BHYT_CS.ValueMember="ten";
            cboBHTN24BHYT_CS.DataSource = mDB.get_data("SELECT * FROM " + m_user + ".dmBHYT").Tables[0];
			cboBHTN24BHYT_CS.SelectedIndex=-1;
		}
		private void Bh2()
		{
			cboBHNTBHYT_CS.DisplayMember="ten";
			cboBHNTBHYT_CS.ValueMember="ten";
            cboBHNTBHYT_CS.DataSource = mDB.get_data("SELECT * FROM " + m_user + ".dmBHYT").Tables[0];
			cboBHNTBHYT_CS.SelectedIndex=-1;
		}
		private void Bh3()
		{
			cboBHKBHYT_CS.DisplayMember="ten";
			cboBHKBHYT_CS.ValueMember="ten";
            cboBHKBHYT_CS.DataSource = mDB.get_data("SELECT * FROM " + m_user + ".dmBHYT").Tables[0];
			cboBHKBHYT_CS.SelectedIndex=-1;
		}

		private void butKetThuc_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void txtDBHYT_CS_Validated(object sender, System.EventArgs e)
		{
            txtDBHYT_CS.Text = txtDBHYT_CS.Text.Trim();
            if (txtDBHYT_CS.Text == "  /  /") return;
            if(!mDB.kiemtrangayhople(txtDBHYT_CS.Text.Trim()))
			{
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày không hợp lệ"),AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
				cboTBVBHYT_CS.Focus();
				return ;
			}
			//
			cboTBVBHYT_CS.SelectedValue=mDB.Mabv.ToString();
			SendKeys.Send("{F4}"); 
		}

		private void txtNCLD_CS_Validated(object sender, System.EventArgs e)
		{
            txtNCLD_CS.Text = txtNCLD_CS.Text.Trim();
            if (txtNCLD_CS.Text == "  /  /")
            {
                return;
            }
            if(!mDB.kiemtrangayhople(txtNCLD_CS.Text.Trim()))
			{
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày không hợp lệ"),AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
				txtNCLD_CS.Focus();
				return ;
			}
		}

		private void txtNChuyenLD_CS_Validated(object sender, System.EventArgs e)
		{
            txtNChuyenLD_CS.Text = txtNChuyenLD_CS.Text.Trim();
            if (txtNChuyenLD_CS.Text == "  /  /") return;
            if(!mDB.kiemtrangayhople(txtNChuyenLD_CS.Text.Trim()))
			{
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày không hợp lệ"),AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
				txtNChuyenLD_CS.Focus();
				return ;

			}
		}

		private void txtTHTBHYT_CS_Validated(object sender, System.EventArgs e)
		{
            txtTHTBHYT_CS.Text = txtTHTBHYT_CS.Text.Trim();
            if (txtTHTBHYT_CS.Text == "  /  /") return;
            if(!mDB.kiemtrangayhople(txtTHTBHYT_CS.Text.Trim()))
			{
                MessageBox.Show(lan.Change_language_MessageText("Nhập ngày không hợp lệ"),AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtTHTBHYT_CS.Focus();
				return;
			}
		}

        private void btnSua_Click(object sender, EventArgs e)
        {
            setcontrol(true);
           // btnSua.Enabled = admin;
            btnSua.Enabled = false;
            butHuy.Enabled = admin;
            butThem.Enabled = true;
        }

        private void frmCapSo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Alt && e.KeyCode == Keys.L)
            {
                butThem_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.S)
            {
                btnSua_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.H)
            {
                butHuy_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.K)
            {
                butKetThuc_Click(null, null);
            }
        }

	}
}
